package com.cyd.base;

import android.content.Context;
import android.os.Environment;
import android.os.IBinder;
import android.view.View;
import android.view.inputmethod.InputMethodManager;

public class APPBASE {

	public final static String FINDPROVINCE = "select name from china_provinces_code";

	public static String getExternalDir() {
		return Environment.getExternalStorageDirectory().getAbsolutePath();
	}

	public static void hideKeyBoard(Context context, IBinder windowToken,
			View targetView, int flags) {
		InputMethodManager imm = (InputMethodManager) context
				.getSystemService(Context.INPUT_METHOD_SERVICE);
		if (imm.isActive(targetView)) {
			imm.hideSoftInputFromWindow(windowToken, flags);
		}
	}

	public static void showKeyBoard(Context context, View targetView) {
		InputMethodManager imm = (InputMethodManager) context
				.getSystemService(Context.INPUT_METHOD_SERVICE);
		imm.showSoftInput(targetView, InputMethodManager.SHOW_FORCED);
	}
}
